package com.haidao.admin.core.exception;

import java.util.Objects;

public class Assert {
    private Assert() {
        throw new AssertionError("No package com.haidao.maintain.base.exception.ObjectUtils instances for you!");
    }

    public static void notNull(Object obj, String message) {
        if (obj == null) {
            throw new ServiceException(message);
        }
    }

    public static void equals(Object a, Object b, String message) {
        if (!Objects.equals(a, b)) {
            throw new ServiceException(message);
        }
    }

    public static void isTrue(boolean expression, String message) {
        if (!expression) {
            throw new ServiceException(message);
        }
    }

}
